/** @format */

import React from 'react';
import {BrowserRouter, Route, Switch} from 'react-router-dom';
import Fragment from './fragment';
import Blog from './blog';
import AddBlog from './addblog';
import Setting from './setting';

interface IProps {
  [propName: string]: any;
}

class Content extends React.Component<IProps> {
  constructor(props: IProps) {
    super(props);
  }

  render(): JSX.Element {
    return (
      <BrowserRouter key={Date.now()}>
        <Switch>
          <Route path="/post/:id" component={Blog} />
          <Route path="/fragment" component={Fragment} />
          <Route path="/addblog/:id" component={AddBlog} />
          <Route path="/addblog" component={AddBlog} />
          <Route path="/setting" component={Setting} />
          <Route path="" component={Fragment} />
        </Switch>
      </BrowserRouter>
    );
  }
}

export default Content;
